-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for historical data #27
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing this!
last_update=datetime.datetime.fromtimestamp(data["x"] / 1000), | ||
)) | ||
|
||
return fear_greed_historical |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the values in response["data"]
guaranteed to be sorted by date?
Consider sorting them here to return the response is deterministic.
Please update the |
I'm still a git noob it seems, wasn't aware that subsequent commits get automatically included in pull request
The historical method raises error when no data is found Additionally, the data is sorted from distant to most recent in case the data source provides unsorted data
Tests for the correct number of entries. Tests the first and last 5 entries of the historical data to make sure dataset is sorted in the correct order. I chose not to cross check the entire dataset to prevent bloating. We can reasonable assume based on the first and last five entries that method works as expected
We can now query historical fear and greed data from the can data source directly. The default range of data that is returned is 1 year.